import request from '@/config/axios'

// 列表
export const getProjectList = (data) => {
  return request.get({
    url: '/service/project/page',
    params: data
  })
}

// 详情
export const getProjectDetail = (id) => {
  return request.get({
    url: '/service/project/get',
    params: { id }
  })
}

// 查询项目下关联的子合同
export const getProjectChildContract = (id) => {
  return request.get({
    url: `/service/project/get-child-contract/${id}`,
    params: { }
  })
}

// 新增
export const addProject = (data) => {
  return request.post({
    url: '/service/project/create',
    data,
  })
}

// 编辑
export const editProject = (data) => {
  return request.put({
    url: '/service/project/update',
    data,
  })
}

// 删除
export const deleteProject = (id) => {
  return request.delete({
    url: '/service/project/delete',
    params: { id }
  })
}

// 导出
export const exportProject = (data) => {
  return request.download({
    url: '/service/project/export-excel',
    params: data,
  })
}



// 获取收支情况
export const getProjectSettlement = (id) => {
  return request.get({
    url: `/service/project/get-settlement/${id}`,
    params: { }
  })
}

// 新增收支结算信息
export const addProjectSettlement = (data) => {
  return request.post({
    url: '/service/project/add-settlement',
    data,
  })
}

// 编辑收支结算信息
export const editProjectSettlement = (data) => {
  return request.put({
    url: '/service/project/update-settlement',
    data,
  })
}

// 删除收支结算信息
export const deleteProjectSettlement = (data) => {
  return request.delete({
    url: '/service/project/delete-settlement',
    params: data 
  })
}